<template>
	<el-container>
		<el-header style="height: auto;">
			<sc-select-filter :data="filterData" :label-width="80" @on-change="filterChange"></sc-select-filter>
		</el-header>
		<el-header>
			<div class="left-panel">
				<el-button type="primary" icon="el-icon-plus"></el-button>
				<el-button type="danger" plain icon="el-icon-delete"></el-button>
			</div>
			<div class="right-panel">
				<div class="right-panel-search">
					<el-input v-model="search.keyword" placeholder="关键词" clearable></el-input>
					<el-button type="primary" icon="el-icon-search" @click="upsearch"></el-button>
				</div>
			</div>
		</el-header>
		<el-main class="nopadding">
			<scTable ref="table" :apiObj="list.apiObj" row-key="id" stripe>
				<el-table-column label="资源名称" prop="meta.title"></el-table-column>
                <el-table-column label="所属应用" prop="applicationName"></el-table-column>
				<el-table-column label="路径" prop="path" ></el-table-column>
				<el-table-column label="类型" prop="type" ></el-table-column>
                <el-table-column label="排序" prop="sort" ></el-table-column>
                <el-table-column label="icon" prop="meta.icon" ></el-table-column>
                <el-table-column label="固定" prop="meta.affix" ></el-table-column>
				<el-table-column label="操作" fixed="right" align="right" width="160">
					<template #default>
						<el-button-group>
							<el-button text type="primary" size="small">查看</el-button>
							<el-button text type="primary" size="small">编辑</el-button>
							<el-button text type="primary" size="small">删除</el-button>
						</el-button-group>
					</template>
				</el-table-column>
			</scTable>
		</el-main>
	</el-container>
</template>

<script>
	import scSelectFilter from '@/components/scSelectFilter'

	export default {
		name: 'listTab',
		components: {
			scSelectFilter
		},
		data() {
			return {
				groupId: "0",
				filterData: [],
				list: {
					apiObj: this.$API.system.sysResource.list
				},
				search: {
					keyword: ""
				}
			}
		},
        mounted(){
            this.sortList();
        },
		methods: {
            async sortList()
            {
                const res = await this.$API.system.sysApplication.sortList.get();
                this.filterData = res.data;
            }
		}
	}
</script>

<style>
</style>
